package com.company.cloud.coupon.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import org.springframework.stereotype.Component;

import com.company.cloud.coupon.modules.api.request.Lock2UseCouponRequest;
import com.company.cloud.coupon.modules.api.request.LockCouponRequest;
import com.company.cloud.coupon.modules.api.request.UnLockCouponRequest;
import com.company.cloud.coupon.modules.api.request.Use2notCouponRequest;
import com.company.cloud.coupon.modules.api.request.UseCouponRequest;
import com.company.cloud.coupon.modules.api.response.LockCouponResponse;
import com.company.cloud.coupon.modules.api.response.UseCouponResponse;
import com.company.cloud.coupon.modules.api.service.CouponRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class CouponRemoteServiceFallbackFactory implements FallbackFactory<CouponRemoteService>{

	@Override
	public CouponRemoteService create(Throwable cause) {
		return new CouponRemoteService() {

			@Override
			public BaseClientResult<LockCouponResponse> lockCoupon(LockCouponRequest param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> unLockCoupon(UnLockCouponRequest param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> lock2UseCoupon(Lock2UseCouponRequest param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<UseCouponResponse> useCoupon(UseCouponRequest param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> use2notCoupon(Use2notCouponRequest param) {
				return BaseClientResult.callbackError();
			}
		};
	}
	
}
